package com.loukou.lkt.lkt.resp;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class PageModel<T> implements Serializable {

    /**
	 * 
	 */
	private static final long serialVersionUID = -4740946905443084577L;
	private long recordsTotal;
	private long recordsFiltered;
    private List<T> data = new ArrayList<>();
    private int pageNo;
    private int pageSize;
    private int totalPageNum;
    private int draw = 1;

    public PageModel() {
    }

    public PageModel(int pageNo, int pageSize, int totalPageNum, long recordNum) {
        this.pageNo = pageNo;
        this.pageSize = pageSize;
        this.totalPageNum = totalPageNum;
        this.recordsTotal = recordNum;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    } 

    public long getRecordsFiltered() {
		return recordsFiltered;
	}

	public void setRecordsFiltered(long recordsFiltered) {
		this.recordsFiltered = recordsFiltered;
	}

	public long getRecordsTotal() {
		return recordsTotal;
	}

	public void setRecordsTotal(long recordsTotal) {
		this.recordsTotal = recordsTotal;
	}

	public List<T> getData() {
		return data;
	}

	public void setData(List<T> data) {
		this.data = data;
	}

	public int getDraw() {
		return draw;
	}

	public void setDraw(int draw) {
		this.draw = draw;
	}

	public long getRecordNum() {
        return recordsTotal;
    }

    public void setRecordNum(long recordNum) {
        this.recordsTotal = recordNum;
    }

    public int getPageNo() {
        return pageNo;
    }

    public void setPageNo(int pageNo) {
        this.pageNo = pageNo;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

	public int getTotalPageNum() {
		return totalPageNum;
	}

	public void setTotalPageNum(int totalPageNum) {
		this.totalPageNum = totalPageNum;
	}

//    public int getTotalPages() {
//        return (pageSize == 0) ? 0 : (int) Math.ceil(recordNum * 1.0 / pageSize);
//    }
}